<?php

namespace App\Service\Common;

use App\Params\Common\CommonListParam;
use App\Params\Common\ImageListParams;
use App\Repository\ImageRepo;
use App\Service\BaseService;

class ImageService extends BaseService
{
    /**
     *  图片列表
     * @param ImageListParams $params
     * @return array
     */
    public function getList(ImageListParams $params): array
    {
        $query = ImageRepo::getInstance()->getQuery($params->toArray());
        return $this->toReturnList($query, $params->getPage(), $params->getPageSize());
    }

    public function getTypeList(CommonListParam $params): array
    {
        $query = ImageRepo::getInstance()->getTypeQuery($params->toArray());
        return $this->toReturnList($query, $params->getPage(), $params->getPageSize());
    }
}
